home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bits_dll / bits.txt < prev    next >
Text File  |  1992-04-13  |  6KB  |  134 lines

  1. Bits.DLL was created to add some much need bit and byte-wise operands
  2. to my Visual Basic applications ... they weren't hard to write, but
  3. they did involve an investment in some serious technology (including
  4. Borland C++ 3.0 Professional, Visual Basic and assorted books).
  5.  
  6. So here's the poop. If you use these for your own personal, non-commercial
  7. use ... it's freeware.
  8.  
  9. If you're incorporating these routines in a commercial product, be it
  10. over-the-counter, mail-order, shareware etc ... it requires my written
  11. perssion depending on the scope of the product (though I figure any 
  12. big-time operation is probably going to write their own) ... in most 
  13. cases it'll be a swap with the shareware author, or a very nominal fee.
  14.  
  15. If there is an interest in these, I'll expand them, and will create
  16. other dynamic link libraries as well (e.g. string handlers, quick
  17. sorts and other low-level nasties that take a bazillion lines of BASIC
  18. to every one or two lines of C or C++).
  19.  
  20.  
  21. Here's how you reach me :
  22.  
  23.     Slow way :
  24.     Constantine Peters
  25.     14409 Briarwood Terrace
  26.     Rockville, MD 20853
  27.  
  28.     Here's the fast way :
  29.     ENIAC MIDI BBS, Constantine Peters Sysop (convenient ain't it ?)
  30.     (301)460-9134, FidoNet/Node 109/440, 9600bps USR HST, 24hrs
  31.  
  32.  
  33. Here are the current functions as of this release .....
  34.  
  35. ------------------------- ByteHigh ---------------------------
  36. Usage       :   Declare Function ByteHigh Lib "BITS.DLL" (ByVal e1%) As Integer    
  37.                 i% = ByteHigh(e1%)
  38. Parameters  :   Integer e1%
  39. Return Value:   Integer - Most significant/High order bit of e1% 
  40. Comments    :
  41. See Also    :   ByteLow, BitShiftLeft
  42.  
  43.  
  44. ------------------------- ByteLow  ---------------------------
  45. Usage       :   Declare Function ByteLow Lib "BITS.DLL" (ByVal e1%) As Integer    
  46.                 i% = ByteLow(e1%)
  47. Parameters  :   Integer e1%
  48. Return Value:   Integer - Least significant/Low order bit of e1% 
  49. Comments    :
  50. See Also    :   ByteHigh, BitOr
  51.  
  52.  
  53. ------------------------- BitPack  ---------------------------
  54. Usage       :   Declare Function BitPack Lib "BITS.DLL" (ByVal eHi%, ByVal eLo%) As Integer    
  55.                 i% = BitPack(eHi%, eLo%)
  56. Parameters  :   Integer eHi% - High Order (Most Significant) Byte
  57.                 Integer eLo% - Low Order (Least Significant) Byte
  58. Return Value:   Integer - combined or "packed" value of High & Lo order bytes
  59. Comments    :   The term "Bit Packing" actually refers to packing two bytes
  60.                 in most modern instances, however, this old term has stuck.
  61.                 Don't let it confuse you, we're packing two bytes.
  62. See Also    :   ByteHigh, BitLow
  63.  
  64.  
  65. ------------------------- BitAnd  ---------------------------
  66. Usage       :   Declare Function BitAnd Lib "BITS.DLL" (ByVal e1%, ByVal e2%) As Integer    
  67.                 i% = BitAnd(e1%, e2%)
  68. Parameters  :   Integer e1% - exponent 1, number to AND
  69.                 Integer e2% - mask, number to AND against e1%
  70. Return Value:   Integer - e2% AND masked against e1%
  71. Comments    :   1 AND 1 = 1 (true)  
  72.                 1 AND 0 = 0 (false)
  73.                 0 AND 0 = 1 (true)
  74.                 0 AND 1 = 0 (false)
  75.                 I realize most true and false in BASIC is -1 for True
  76.                 and 0 for False, but I will use this DLL in other 
  77.                 languages such as Actor 4.0
  78. See Also    :   BitOr, BitXOr
  79.  
  80.  
  81. ------------------------- BitOr  ---------------------------
  82. Usage       :   Declare Function BitOr Lib "BITS.DLL" (ByVal e1%, ByVal e2%) As Integer    
  83.                 i% = BitOr(e1%, e2%)
  84. Parameters  :   Integer e1% - exponent 1, number to Or
  85.                 Integer e2% - mask, number to OR against e1%
  86. Return Value:   Integer - e2% OR masked against e1%
  87. Comments    :   1 OR 1 = 1 (true)  
  88.                 1 OR 0 = 0 (true)
  89.                 0 OR 0 = 1 (false)
  90.                 0 OR 1 = 0 (true)
  91.                 I realize most true and false in BASIC is -1 for True
  92.                 and 0 for False, but I will use this DLL in other 
  93.                 languages such as Actor 4.0
  94. See Also    :   BitAnd, BitXOr
  95.  
  96.  
  97. ------------------------- BitXOr  ---------------------------
  98. Usage       :   Declare Function BitXOr Lib "BITS.DLL" (ByVal e1%, ByVal e2%) As Integer    
  99.                 i% = BitXOr(e1%, e2%)
  100. Parameters  :   Integer e1% - exponent 1, number to XOR
  101.                 Integer e2% - mask, number to XOR against e1%
  102. Return Value:   Integer - e2% XOR masked against e1%
  103. Comments    :   1 XOR 1 = 1 (false) 
  104.                 1 XOR 0 = 0 (false)
  105.                 0 XOR 0 = 1 (true) 
  106.                 0 XOR 1 = 0 (false)
  107.                 Treat XOR like "opposite day" in school, whatever is
  108.                 true under OR is now false ("everything I'm telling you
  109.                 is a lie" ... Harvey Mudd)
  110. See Also    :   BitAnd, BitOr
  111.  
  112. ------------------------- BitShiftLeft  ---------------------------
  113. Usage       :   Declare Function BitShiftLeft Lib "BITS.DLL" (ByVal e1%, ByVal e2%) As Integer    
  114.                 i% = BitShiftLeft(e1%, e2%)
  115. Parameters  :   Integer e1% - exponent 1, number to shift
  116.                 Integer e2% - amount to shift e1%
  117. Return Value:   Integer -  e1% shifted by the amount of e2%
  118. Comments    :   This is an excellent operation for FAST multiplication
  119.                 and/or division !
  120. See Also    :   ByteHigh, BitShiftRight
  121.  
  122.  
  123. ------------------------- BitShiftLeft  ---------------------------
  124. Usage       :   Declare Function BitShiftLeft Lib "BITS.DLL" (ByVal e1%, ByVal e2%) As Integer    
  125.                 i% = BitShiftLeft(e1%, e2%)
  126. Parameters  :   Integer e1% - exponent 1, number to shift
  127.                 Integer e2% - amount to shift e1%
  128. Return Value:   Integer -  e1% shifted by the amount of e2%
  129. Comments    :   This is an excellent operation for FAST multiplication
  130.                 and/or division !
  131. See Also    :   ByteHigh, BitShiftLeft
  132.  
  133.     
  134.